#!/bin/bash

echo "正在启动作品展示系统..."
echo

echo "1. 检查依赖..."
if [ ! -d "node_modules" ]; then
    echo "安装前端依赖..."
    npm install
fi

if [ ! -d "server/node_modules" ]; then
    echo "安装后端依赖..."
    npm run install:server
fi

echo
echo "2. 启动服务..."
echo "前端: http://localhost:9080"
echo "后端: http://localhost:9081"
echo
echo "按 Ctrl+C 停止服务"
echo

npm run dev